package role

import player.Player
import poker.Poker

fun PokerCompareTwo(p1:Poker,p2:Poker):Boolean{//判断第一张牌是否比第二张牌大
    return if(p1.numberObj.tag==p2.numberObj.tag) {
        p1.suitObj.tag>p2.suitObj.tag
    }
    else{
        p1.numberObj.tag>p2.numberObj.tag
    }
}
fun findMaxPlayer(players:List<Player>): Player {
    var max = players[0]
    for (player in players){
        if(!PokerCompareTwo(max.poker,player.poker)){
            max = player
        }
    }
    return max
}